package com.tang;

import java.util.Scanner;

/**
 * 最多提取子串数目
 *
 * @author tang
 * @since 2023/5/19 11:43
 */
public class Od001 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.nextLine();
        String b = scanner.nextLine();

        int count = 0, i = 0, j = 0;

        char[] arrA = a.toCharArray();
        char[] arrB = b.toCharArray();

        int aLen = a.length();
        int bLen = b.length();
        while (i < aLen) {
            if (arrA[i] == arrB[j]) {
                arrA[i] = '*';
                j++;
            }
            if (j == bLen) {
                i = 0;
                j = 0;
                count++;
            } else {
                i++;
            }

        }
        System.out.println(count);

    }

}
